package com.decade.sp04.order.feign;

import com.decade.sp01.pojo.User;
import com.decade.web.util.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author: decade
 * @Description: 远程调用用户服务
 * @Date: 2021/1/21 11:38
 **/
@FeignClient(name="user-service", fallback = UserClientFB.class)
public interface UserClient {
    @GetMapping("/{userId}")
    JsonResult<User> getUser(@PathVariable Integer userId);

    @GetMapping("/{userId}/score")
    JsonResult addScore(@PathVariable Integer userId, @RequestParam Integer score);
}
